package com.stjb.furns.entity;

import java.math.BigDecimal;

/**
 * Furn 和表之间映射
 * @author situ
 * @version 1.0
 *
 */
public class Furn {
    /*
        CREATE table `furn`(
        `id` INT UNSIGNED PRIMARY KEY auto_increment,
        `name` VARCHAR(64) NOT NULL,
        `maker` VARCHAR(64) NOT null,
        `price` DECIMAL(11,2) NOT NULL,
        `sales` INT UNSIGNED NOT null,
        `stock` int UNSIGNED not null,
        `img_path` VARCHAR(256) not NULL
        )CHARSET utf8 ENGINE INNODB
     */

    private Integer id; //Integer防止null
    private String name;
    private String maker;
    private BigDecimal price;
    private Integer sales;
    private Integer stock;

    private String imgPath = "assets/images/product-image/default.jpg";

    @Override
    public String toString() {
        return "Furn{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", maker='" + maker + '\'' +
                ", price=" + price +
                ", sales=" + sales +
                ", stock=" + stock +
                ", imgPath='" + imgPath + '\'' +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMaker() {
        return maker;
    }

    public void setMaker(String maker) {
        this.maker = maker;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getSales() {
        return sales;
    }

    public void setSales(Integer sales) {
        this.sales = sales;
    }

    public Integer getStock() {
        return stock;
    }

    public void setStock(Integer stock) {
        this.stock = stock;
    }

    public String getImgPath() {
        return imgPath;
    }

    public void setImgPath(String imgPath) {
        this.imgPath = imgPath;
    }

    public Furn(Integer id, String name, String maker, BigDecimal price, Integer sales, Integer stock, String imgPath) {
        this.id = id;
        this.name = name;
        this.maker = maker;
        this.price = price;
        this.sales = sales;
        this.stock = stock;
        if(!(null == imgPath || "".equals(imgPath))) {
            this.imgPath = imgPath;
        }
    }

    public Furn() {
    }



}
